home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Forms Misc
/
char-counter.izs
< prev
next >
Wrap
Text File
|
2005-09-28
|
6KB
|
285 lines
<!NOWIZARD>
<!TITLE>Character Counter
<!/TITLE>
<!DESCRIPTION>This clever text box counts down the letter remaining as you type them in!<!/DESCRIPTION>
<!CATEGORY>Forms<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CHARACTER COUNTER:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<script type="text/javascript">
<!-- Written by Steve - http://jsmadeeasy.com/ -->
<!--
function getObject(obj) {
var theObj;
if(document.all) {
if(typeof obj=="string") {
return document.all(obj);
} else {
return obj.style;
}
}
if(document.getElementById) {
if(typeof obj=="string") {
return document.getElementById(obj);
} else {
return obj.style;
}
}
return null;
}
//Contador de caracteres.
function Contar(entrada,salida,texto,caracteres) {
var entradaObj=getObject(entrada);
var salidaObj=getObject(salida);
var longitud=caracteres - entradaObj.value.length;
if(longitud <= 0) {
longitud=0;
texto='<span class="disable"> '+texto+' </span>';
entradaObj.value=entradaObj.value.substr(0,caracteres);
}
salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}
//-->
</script>
<style type="text/css">
<!--
BODY {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: Black;
margin-left: 0px;
margin-right: 0px;
background-color: White;
}
.minitext {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 8pt;
font-weight: normal;
color: Black;
}
.0 {
background-color: #4786D2;
}
.1 {
background-color: #D3E8FD;
}
.2 {
background-color: #D3E8FD;
}
.3 {
background-color: #D3E8FD;
}
.4 {
background-color: #D3E8FD;
}
TABLE {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: Black;
}
INPUT.text {
background-color: #FFFFFF;
color: Black;
border: 2px ridge Black;
font-size: 10px;
font-family: Verdana, Arial;
font-weight: normal;
}
.enable {
background-color: #77FF77;
font-weight: bold;
color: Black;
}
.disable {
background-color: #FF7777;
font-weight: bold;
color: Black;
}
-->
</style>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<form action="#" method="post">
<table align="center" class="0" border="0" cellspacing="1" cellpadding="5">
<tr>
<td align="right" class="1"><span class="options">Field Name</span></td>
<td class="2"><INPUT TYPE="TEXT" class="text" id="eBann" name="bannerURL" maxlength="100" size="60" onKeyUp="Contar('eBann','sBann','{CHAR} characters left.',100);"><br><span id="sBann" class="minitext">100 characters left.</span></td>
</tr>
</table>
</form>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CHARACTER COUNTER:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<script type="text/javascript">
<!-- Written by Steve - http://jsmadeeasy.com/ -->
<!--
function getObject(obj) {
var theObj;
if(document.all) {
if(typeof obj=="string") {
return document.all(obj);
} else {
return obj.style;
}
}
if(document.getElementById) {
if(typeof obj=="string") {
return document.getElementById(obj);
} else {
return obj.style;
}
}
return null;
}
//Contador de caracteres.
function Contar(entrada,salida,texto,caracteres) {
var entradaObj=getObject(entrada);
var salidaObj=getObject(salida);
var longitud=caracteres - entradaObj.value.length;
if(longitud <= 0) {
longitud=0;
texto='<span class="disable"> '+texto+' </span>';
entradaObj.value=entradaObj.value.substr(0,caracteres);
}
salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}
//-->
</script>
<style type="text/css">
<!--
BODY {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: Black;
margin-left: 0px;
margin-right: 0px;
background-color: White;
}
.minitext {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 8pt;
font-weight: normal;
color: Black;
}
.0 {
background-color: #4786D2;
}
.1 {
background-color: #D3E8FD;
}
.2 {
background-color: #D3E8FD;
}
.3 {
background-color: #D3E8FD;
}
.4 {
background-color: #D3E8FD;
}
TABLE {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: Black;
}
INPUT.text {
background-color: #FFFFFF;
color: Black;
border: 2px ridge Black;
font-size: 10px;
font-family: Verdana, Arial;
font-weight: normal;
}
.enable {
background-color: #77FF77;
font-weight: bold;
color: Black;
}
.disable {
background-color: #FF7777;
font-weight: bold;
color: Black;
}
-->
</style>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<form action="#" method="post">
<table align="center" class="0" border="0" cellspacing="1" cellpadding="5">
<tr>
<td align="right" class="1"><span class="options">Field Name</span></td>
<td class="2"><INPUT TYPE="TEXT" class="text" id="eBann" name="bannerURL" maxlength="100" size="60" onKeyUp="Contar('eBann','sBann','{CHAR} characters left.',100);"><br><span id="sBann" class="minitext">100 characters left.</span></td>
</tr>
</table>
</form>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>